<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="model.*"%>
<%@ page import="dao.*"%>
<%@ page import="java.util.*"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%
	View view = ViewDao.getViewNoCache("jingdian1");
	request.setAttribute("view", view);
%>
<!DOCTYPE html>
<html lang="en" class="no-js">
<head>
<meta charset="utf-8" />
<title>路游路线</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="width=device-width, initial-scale=1" name="viewport" />
<meta content="" name="description" />
<meta content="" name="author" />
<link
	href="http://fonts.googleapis.com/css?family=Hind:300,400,500,600,700"
	rel="stylesheet" type="text/css">
<link href="vendor/simple-line-icons/simple-line-icons.min.css"
	rel="stylesheet" type="text/css" />
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet"
	type="text/css" />
<link href="css/animate.css" rel="stylesheet">
<link href="vendor/swiper/css/swiper.min.css" rel="stylesheet"
	type="text/css" />

<!-- THEME STYLES -->
<link href="css/layout.min.css" rel="stylesheet" type="text/css" />

<!-- Favicon -->
<link rel="shortcut icon" href="favicon.ico" />
</head>
<!-- END HEAD -->

<!-- BODY -->
<body id="body" data-spy="scroll" data-target=".header">

	<jsp:include page="Header.jsp" flush="true"></jsp:include>


	<!-- Latest Products -->
	<div id="景点评论">
		<div class="content-lg container">
			<div class="row margin-b-40">
				<div class="col-sm-6">
					<h2>景点评论</h2>
					<p></p>
				</div>
			</div>
			<!--// end row -->

			<div class="row">
				<h3>景点名称&nbsp;:&nbsp;${view.vcname}</h3>
				<div class="col-sm-12 sm-margin-b-50">

					<img class="img-responsive" src="${view.location }"
						alt="Latest Products Image">

					<h4>景点价格&nbsp;:&nbsp;${view.price}</h4>
					<h4>景点信息&nbsp;:&nbsp;${view.info}</h4>

					<br> <br> <br>
				</div>
				<div class="col-lg-4">
					<ul class="list-group">
						<li class="list-group-item"><span
							class="badge list-group-item-success">${view.getMessages().size() }</span>
							这里已经有很多评论啦！</li>
					</ul>
				</div>
			</div>
			<c:forEach var="message" items="${view.getMessages() }"
				varStatus="status">
				<p>&nbsp;</p>
								<div class="media">
					<div class="media-left">
						<img class="media-object" src="img/tx1.jpg" alt="...">
					</div>
					<div class="media-body">
						<h4 class="media-heading">${message.getTourist().name }</h4>
						<p>${message.info }</p>
						<p>${status.index+1 }楼&nbsp;&nbsp;<fmt:formatDate
								value="${message.time }" pattern="yyyy-MM-dd" />
							发表
						</p>

						<hr>
					</div>
				</div>
				
				<c:choose>
					<c:when test="${view.name=='jingdian1'}">
						<p>123</p>
					</c:when>
					<c:otherwise>
						<td></td>
						<td></td>
					</c:otherwise>
				</c:choose>

			</c:forEach>
			<form action="AddMessageServlet" method="post">

				<div class="col-xs-8">
					<div class="form-group">
						<label for="name">添加评论</label>
						<textarea name="message" class="form-control"></textarea>
					</div>
				</div>
				<div class="row"></div>

				<div class="form-group">
					<div class="col-xs-6"></div>
					<input type="submit" class="btn btn-default " value="发布评论">
				</div>
			</form>
		</div>
		<!--// end row -->

	</div>
	</div>
	<!-- End Latest Products -->

	<jsp:include page="Footer.jsp" flush="true"></jsp:include>
	<!-- Back To Top -->
	<a href="javascript:void(0);" class="js-back-to-top back-to-top">Top</a>

	<!-- JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
	<!-- CORE PLUGINS -->
	<script src="vendor/jquery.min.js" type="text/javascript"></script>
	<script src="vendor/jquery-migrate.min.js" type="text/javascript"></script>
	<script src="vendor/bootstrap/js/bootstrap.min.js"
		type="text/javascript"></script>

	<!-- PAGE LEVEL PLUGINS -->
	<script src="vendor/jquery.easing.js" type="text/javascript"></script>
	<script src="vendor/jquery.back-to-top.js" type="text/javascript"></script>
	<script src="vendor/jquery.smooth-scroll.js" type="text/javascript"></script>
	<script src="vendor/jquery.wow.min.js" type="text/javascript"></script>
	<script src="vendor/swiper/js/swiper.jquery.min.js"
		type="text/javascript"></script>
	<script src="vendor/masonry/jquery.masonry.pkgd.min.js"
		type="text/javascript"></script>
	<script src="vendor/masonry/imagesloaded.pkgd.min.js"
		type="text/javascript"></script>

	<%
		String flag = "";
		String scerror = "";
		flag = (String) request.getAttribute("flag");
		System.out.println("jspflag" + flag);
		if (flag != null) {
			if (flag.equals("1")) {
				scerror = "添加成功。";
				out.print("<script language='javascript'>alert('" + scerror + "');</script>");
			}
			if (flag.equals("0")) {
				scerror = "添加失败。";
				out.print("<script language='javascript'>alert('" + scerror + "');</script>");
			}

		}
		System.out.println(scerror);
	%>
	<!-- PAGE LEVEL SCRIPTS -->
	<script src="js/layout.min.js" type="text/javascript"></script>
	<script src="js/components/wow.min.js" type="text/javascript"></script>
	<script src="js/components/swiper.min.js" type="text/javascript"></script>
	<script src="js/components/masonry.min.js" type="text/javascript"></script>
	<script src="js/components/google-map.min.js" type="text/javascript"></script>

</body>
<!-- END BODY -->
</html>